<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<script src="vue.js"></script>
</head>
<body>
	<div id="root">
		<div @click="handleClick">
			{{message}}
		</div>
		<item></item>
	</div>
	<script>
		//全局注册
		Vue.component('item', {
			template: '<div>hello item</div>'
		})

		var vm = new Vue({
			el: '#root',
			data: {
				message: 'hello world'
			},
			methods:{
				handleClick: function(){
					alert('hello')
				}
			}
		})
	</script>
</body>
</html>